package com.quanyan.assets.service;

import com.quanyan.api.APIResponse;
import com.quanyan.assets.entity.TbCoupon;
import com.quanyan.assets.entity.TbCouponInfo;
import com.quanyan.assets.entity.CouponInfoVo;
import com.quanyan.assets.entity.vo.CounponInfoRespVo;
import com.quanyan.assets.entity.vo.RespActivityCouponListVo;
import com.quanyan.assets.request.ReqCouponRefund;
import com.quanyan.common.enums.BaseEnum;

import java.text.ParseException;
import java.util.Date;
import java.util.List;

/**
 * Created by wmb on 2016/10/25.
 */

public interface UtilCouponService {

    //冻结退款金额--优惠券
    void refundCouponSubmit(ReqCouponRefund couponRefund);

    //退款金额解冻(成功)--优惠券
    void refundCouponSuccess(ReqCouponRefund couponRefund);

    //退款金额解冻(失败)--优惠券
    void refundCouponFail(ReqCouponRefund couponRefund);

    void expiredHandle();

    //用户领取礼包
    APIResponse<BaseEnum> grantCoupons(Integer uid) throws ParseException;

    //成都场馆开业促销活动
    APIResponse<BaseEnum> grantCoupons2(Integer uid) throws ParseException;

    /**
     * 根据优惠券模板领取优惠券
     * @param couponTemplateCode
     * @param uid
     * @return
     */
    APIResponse<CouponInfoVo> obtainCoupons(String couponTemplateCode, Integer uid);


    /**
     * 根据优惠券模板code找优惠券模板
     * @param couponTemplateCode
     * @return
     */
    TbCoupon getTbCouponByTemplateCode(String couponTemplateCode);

    /**
     * 根据优惠券code找优惠券
     * @param couponCode
     * @return
     */
    TbCouponInfo getTbCouponInfoByCode(String couponCode);

    /**
     * 根据优惠券模板code和uid来查找TbCouponInfo
     * @param couponTemplateCode
     * @param uid
     * @return
     */
    List<TbCouponInfo> findTbCouponInfo(String couponTemplateCode, int uid, byte couponGrantTpe);

    /**
     * 根据优惠券模板code和uid来查找TbCouponInfo
     * @param couponTemplateCodes
     * @param uid
     * @return
     */
    List<TbCouponInfo> findTbCouponInfo(List<String> couponTemplateCodes, int uid, byte couponGrantTpe);

    /**
     * 根据优惠券模板code、uid和领取时间来查找TbCouponInfo
     * @param couponTemplateCodes
     * @param uid
     * @param receiveTimeStart
     * @param receiveTimeEnd
     * @return
     */
    List<TbCouponInfo> findTbCouponInfo(List<String> couponTemplateCodes, int uid, byte couponGrantTpe, Date receiveTimeStart, Date receiveTimeEnd);


    /**
     * 根据优惠券模板code、uid和领取时间来查找TbCouponInfo
     * @param couponTemplateCode
     * @param uid
     * @param receiveTimeStart
     * @param receiveTimeEnd
     * @return
     */
    List<TbCouponInfo> findTbCouponInfo(String couponTemplateCode, int uid, byte couponGrantTpe, Date receiveTimeStart, Date receiveTimeEnd);


    /**
     * 获取活动模板优惠券列表
     * @param activityType
     * @param uid
     * @return
     */
    APIResponse<RespActivityCouponListVo> getActivityCouponList(Byte activityType, Integer uid);


    /**
     * 根据优惠券码领取优惠券
     * @param couponCode
     * @param uid
     * @return
     */
    APIResponse<CouponInfoVo> obtainCouponsByCouponCode(String couponCode, Integer uid);

    /**
     * 根据优惠券码获取优惠券信息
     * @param couponCode
     * @return
     */
    APIResponse<CounponInfoRespVo> getCouponInfo(String couponCode);
}
